package com.slz3.business.module.goodsManagement.gooInWarehouse.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.goodsManagement.gooInWarehouse.domain.GooInWarehouse;
import com.slz3.business.module.goodsManagement.gooInWarehouse.domain.GooInWarehouseCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class GooInWarehouseResController extends GooInWarehouseResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, GooInWarehouse gooInWarehouse) {
        if (GooInWarehouseResUnsafeValid.add(req, gooInWarehouse)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$GooInWarehouseUpdateLock(req, gooInWarehouse);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, GooInWarehouseCondition gooInWarehouseCondition) {
        if (GooInWarehouseResUnsafeValid.delete(req, gooInWarehouseCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$GooInWarehouseUpdateLock(req, gooInWarehouseCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, GooInWarehouse gooInWarehouse) {
        if (GooInWarehouseResUnsafeValid.modify(req, gooInWarehouse)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$GooInWarehouseUpdateLock(req, gooInWarehouse);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (GooInWarehouseResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return gooInWarehouseResAtomic.info_$GooInWarehouseUpdateLock(req);
        if (GooInWarehouseResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$GooInWarehouseUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (GooInWarehouseResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, GooInWarehouseCondition gooInWarehouseCondition) {
        //
        if (GooInWarehouseResUnsafeValid.auditSubmit(req, gooInWarehouseCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$GooInWarehouseUpdateLock(req, gooInWarehouseCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, GooInWarehouseCondition gooInWarehouseCondition) {
        if (GooInWarehouseResUnsafeValid.audit(req, gooInWarehouseCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$GooInWarehouseUpdateLock(req, gooInWarehouseCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, GooInWarehouseCondition gooInWarehouseCondition) {
        if (GooInWarehouseResUnsafeValid.auditReject(req, gooInWarehouseCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$GooInWarehouseUpdateLock(req, gooInWarehouseCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, GooInWarehouseCondition gooInWarehouseCondition) {
        if (GooInWarehouseResUnsafeValid.usingEnable(req, gooInWarehouseCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$GooInWarehouseUpdateLock(req, gooInWarehouseCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, GooInWarehouseCondition gooInWarehouseCondition) {
        if (GooInWarehouseResUnsafeValid.usingDisable(req, gooInWarehouseCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$GooInWarehouseUpdateLock(req, gooInWarehouseCondition);
        }
    }

}
